const path = require('path')
const Koa = require('koa')
const views = require('koa-views')
const boayParser = require('koa-bodyparser')
const router = require('./router')
const config = require('./config')


const app = new Koa()


app.use(boayParser())

app.use(views(path.resolve(__dirname, 'templates'), 
  { map: {html: 'ejs' }}))


app.use(router.routes())
app.use(router.allowedMethods())



app.listen(8000, ()=>{
  console.log('Web server is running ... ^_^')
})
